﻿@model IEnumerable<Vms.Web.Models.SCREEN_BRIGHTNESS>

@{
    ViewBag.Title = "ScreenBrightness";
}

<h2>ScreenBrightness</h2>

<table class="table table-bordered table-striped">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.nAdjustType)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.nHandleLight)
        </th>
        <th>
            Giờ 1
        </th>
        <th>
            @Html.DisplayNameFor(model => model.nLight1)
        </th>
        <th>
            Giờ 2
        </th>
        <th>
            @Html.DisplayNameFor(model => model.nLight2)
        </th>
        <th>
            Giờ 3
        </th>
        <th>
            @Html.DisplayNameFor(model => model.nLight3)
        </th>
        <th>
            Giờ 4
        </th>
        <th>
            @Html.DisplayNameFor(model => model.nLight4)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {

    string h1 = Vms.Web.Lib.ConstData.TimeToString((int)(item.nHour1 != null ? item.nHour1 : 0), (int)(item.nMinute1 != null ? item.nMinute1 : 0));
    string h2 = Vms.Web.Lib.ConstData.TimeToString((int)(item.nHour2 != null ? item.nHour2 : 0), (int)(item.nMinute2 != null ? item.nMinute2 : 0));
    string h3 = Vms.Web.Lib.ConstData.TimeToString((int)(item.nHour3 != null ? item.nHour3 : 0), (int)(item.nMinute3 != null ? item.nMinute3 : 0));
    string h4 = Vms.Web.Lib.ConstData.TimeToString((int)(item.nHour4 != null ? item.nHour4 : 0), (int)(item.nMinute4 != null ? item.nMinute4 : 0));
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.nAdjustType)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.nHandleLight)
        </td>
        <td>
            @h1
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.nLight1)
        </td>
        <td>
            @h2
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.nLight2)
        </td>
        <td>
            @h3
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.nLight3)
        </td>
        <td>
            @h4
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.nLight4)
      <td>
        @Html.ActionLink("Edit", "EditBrightness", new { id=item.Id }) 
      </td>
    </tr>
}

</table>
